package com.doform.android.xianggucheng.activity;

import android.content.Intent;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.allinpay.usdk.core.data.BaseData;
import com.allinpay.usdk.core.data.ResponseData;
import com.doform.android.xianggucheng.R;
import com.doform.android.xianggucheng.activity.downorder.OrderQueryActivity;
import com.doform.android.xianggucheng.utils.Constans;

import butterknife.BindView;

/**
 * 作者 Y_MS
 * Created by ${APEN} on 2017/6/10.
 * GitHub：https://github.com/cxydxpx
 */

public class PayCompleteActivity extends BaseTitleActivity{

    @BindView(R.id.tv_price)
    TextView tv_price;

    @BindView(R.id.tv_date)
    TextView tv_date;

    @BindView(R.id.tv_persion)
    TextView tv_persion;

    @BindView(R.id.btn_submit)
    Button btn_submit;

    private ResponseData responseData;
    private String amount;
    private String date;

    @Override
    protected int layoutResId() {
        return R.layout.activity_pay_complete;
    }

    @Override
    protected void init() {
        this.responseData = (ResponseData) getIntent().getSerializableExtra(Constans.EXTRA_PAY_COMPLETE);
    }

    @Override
    protected void initView() {
    }

    @Override
    protected void initData() {
        //金额
        amount = responseData.getValue(BaseData.AMOUNT);
        date = responseData.getValue(BaseData.DATE);
    }

    @Override
    protected void initListener() {
        btn_submit.setOnClickListener(this);
    }

    @Override
    protected void showView() {
        titleBar.setTextTitle("交易详情");
        tv_price.setText(amount);
        tv_date.setText(date);

    }

    @Override
    protected void processClick(View v) {
        switch (v.getId()) {
            case R.id.btn_submit:
                startActivity(new Intent(this,OrderQueryActivity.class));
                finish();
                break;
            default:
                break;
        }
    }
}
